package org.price.sql.repo.session.tx;

import java.security.Permission;

import org.price.sql.repo.document.model.Document;
import org.price.sql.repo.exceptions.SessionException;

public interface Transaction {
    public boolean isActive();

    public void commit() throws SessionException, SecurityException;

    public void rollback() throws SessionException, SecurityException;

    public void saveDocument(Document doc) throws SessionException,
            SecurityException;

    public void removeDocument(Document doc) throws SessionException,
            SecurityException;

    public void lock(Document doc) throws SessionException, SecurityException;

    public void unlock(Document doc) throws SessionException, SecurityException;

    // Permissions
    public void addPermission(Permission p) throws SecurityException,
            SessionException;

    public void removePermission(Permission p) throws SecurityException,
            SessionException;
}
